home *** CD-ROM | disk | FTP | other *** search
- Path: service-2.agate.net!usenet
- From: ettienne@agate.net (Steve Nutt)
- Newsgroups: comp.lang.c++
- Subject: Re: malloc() function and new operator
- Date: Tue, 09 Apr 1996 06:28:44 GMT
- Organization: DET
- Message-ID: <4kcom7$5u8@service-2.agate.net>
- References: <4kbo18$t1s@news.NetVision.net.il>
- Reply-To: ettienne@agate.net
- NNTP-Posting-Host: ettienne.sdi.agate.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- nir@netvision.net.il (Nir Sofer) wrote:
-
- >I use in my C/C++ programs both malloc() function and new operator.
- >i use new and delete operators for objects and malloc() and free()
- >functions for allocating strings and other variables.
- >
- >i compile my programs with Borland C++ 4.0
- >it works fine, but i want to be sure that i'm not doing something
- >wrong that will cause troubles in the future.
-
- >Is it o.k to use both of them in the same program ?
-
- >Nir Sofer
- >nir@netvision.net.il
-
- What you malloc you should free and what you new you should delete.
-
- As long as you keep to that, you should be able to use malloc and new
- together.
-
- Steve
-
-